package com.homegoods.discover.item;

import com.alibaba.android.arouter.launcher.ARouter;
import com.homegoods.classify.model.Constant;
import com.homegoods.discover.R;
import com.homegoods.discover.model.BestCollectModel;
import com.homegoods.aroutercomment.ARouterPath;
import com.kedll.library.mvp.BaseItem;

/**
 * @author QiQi
 * @ClassName: BestCollectItem
 * @date 2018/9/11
 * @description 精选
 */
public class BestCollectItem extends BaseItem<BestCollectModel> {
    public BestCollectItem(BestCollectModel data) {
        super(data);
        setOnClickListener(v -> ARouter.getInstance()
                .build(ARouterPath.PATH_GOODS_DETAIL)
                .withString("id", data.getSid())
                .navigation());
    }

    public String getImgUrl() {
        return Constant.SERVER_URL+getData().getPublicimg();
    }


    public String getTitle() {
        return getData().getTitle();
    }


    public String getOrigin() {
        return getData().getSource();
    }

    public String getMsgCount() {
        return getData().getCmgnum();
    }

    @Override
    public int getLayout() {
        return R.layout.discover_item_best_collect;
    }
}
